﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs;

namespace signalR消息推送机制.SignalR
{
    /// <summary>
    /// 对所有客户端
    /// </summary>
    [HubName("chat")]
    public class Chat : Hub
    {
        public void Send(string message)
        {
            // Call the addMessage method on all clients            
            Clients.All.addMessage(message);

        }
    }
    /// <summary>
    /// 对指定客户端
    /// </summary>
    public class ChatPerson : Hub
    {
        public void Send(string connectionID, string message)
        {
            Clients.Client(connectionID).addMessage(message);
        }
    }

}